package com.quanyue.haircut.order.mapper;

import com.quanyue.haircut.domain.entity.ReserveInfo;
import com.quanyue.haircut.order.dto.TechnicianCommission;
import com.vhuomai.mybatis.mapper.auto.AutoMapper;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.util.List;

@Mapper
public interface ReserveInfoMapper extends AutoMapper <ReserveInfo, Integer> {

    @Select("select i.phone,i.user_name,i.server_content,i.create_time,t.commission,o.pay_price,o.pay_price * t.commission as pay_commission "
            + "from qy_reserve_info i "
            + "left join qy_technician t on t.id = i.technician "
            + "left join qy_reserve_order o on i.id = o.order_info "
            + "where i.technician = ${technicianId}")
    List <TechnicianCommission> findCommission(@Param("technicianId") Integer technicianId);
}
